.class Lcom/estrongs/android/ui/dialog/c0;
.super Ljava/lang/Object;
.source "NameEditorDialog.java"


# instance fields
.field a:Landroid/content/Context;

.field b:Landroid/app/Dialog;

.field c:Landroid/widget/EditText;

.field d:Z

.field e:Z

.field f:Lcom/estrongs/android/ui/dialog/d0$c;

.field g:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/app/Dialog;Ljava/lang/String;)V
    .locals 3

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-boolean v0, p0, Lcom/estrongs/android/ui/dialog/c0;->d:Z

    const/4 v1, 0x1

    .line 3
    iput-boolean v1, p0, Lcom/estrongs/android/ui/dialog/c0;->e:Z

    const/4 v2, 0x0

    .line 4
    iput-object v2, p0, Lcom/estrongs/android/ui/dialog/c0;->f:Lcom/estrongs/android/ui/dialog/d0$c;

    .line 5
    iput-object p1, p0, Lcom/estrongs/android/ui/dialog/c0;->a:Landroid/content/Context;

    .line 6
    iput-object p2, p0, Lcom/estrongs/android/ui/dialog/c0;->b:Landroid/app/Dialog;

    .line 7
    invoke-virtual {p0, v1}, Lcom/estrongs/android/ui/dialog/c0;->a(Z)V

    .line 8
    iput-object p3, p0, Lcom/estrongs/android/ui/dialog/c0;->g:Ljava/lang/String;

    .line 9
    new-instance p2, Landroid/widget/EditText;

    invoke-direct {p2, p1}, Landroid/widget/EditText;-><init>(Landroid/content/Context;)V

    iput-object p2, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    const/high16 p3, 0x41700000    # 15.0f

    .line 10
    invoke-virtual {p2, v1, p3}, Landroid/widget/EditText;->setTextSize(IF)V

    .line 11
    iget-object p2, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    const p3, 0x7f080813

    invoke-virtual {p2, p3}, Landroid/widget/EditText;->setBackgroundResource(I)V

    const/high16 p2, 0x40c00000    # 6.0f

    .line 12
    invoke-static {p1, p2}, Les/fy;->a(Landroid/content/Context;F)I

    move-result p1

    .line 13
    iget-object p2, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    invoke-virtual {p2, v0, p1, p1, p1}, Landroid/widget/EditText;->setPadding(IIII)V

    .line 14
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    move-result-object p2

    const p3, 0x7f060294

    invoke-virtual {p2, p3}, Lcom/estrongs/android/ui/theme/b;->a(I)I

    move-result p2

    invoke-virtual {p1, p2}, Landroid/widget/EditText;->setTextColor(I)V

    .line 15
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    invoke-virtual {p1}, Landroid/widget/EditText;->setSingleLine()V

    .line 16
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    new-instance p2, Lcom/estrongs/android/ui/dialog/c0$a;

    invoke-direct {p2, p0}, Lcom/estrongs/android/ui/dialog/c0$a;-><init>(Lcom/estrongs/android/ui/dialog/c0;)V

    invoke-virtual {p1, p2}, Landroid/widget/EditText;->setOnKeyListener(Landroid/view/View$OnKeyListener;)V

    new-array p1, v1, [Landroid/text/InputFilter;

    .line 17
    new-instance p2, Lcom/estrongs/android/ui/dialog/c0$b;

    const/16 p3, 0xff

    invoke-direct {p2, p0, p3}, Lcom/estrongs/android/ui/dialog/c0$b;-><init>(Lcom/estrongs/android/ui/dialog/c0;I)V

    aput-object p2, p1, v0

    .line 18
    iget-object p2, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    invoke-virtual {p2, p1}, Landroid/widget/EditText;->setFilters([Landroid/text/InputFilter;)V

    .line 19
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    new-instance p2, Lcom/estrongs/android/ui/dialog/c0$c;

    invoke-direct {p2, p0}, Lcom/estrongs/android/ui/dialog/c0$c;-><init>(Lcom/estrongs/android/ui/dialog/c0;)V

    invoke-virtual {p1, p2}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V

    return-void
.end method


# virtual methods
.method public a(Lcom/estrongs/android/ui/dialog/d0$c;)V
    .locals 0

    .line 2
    iput-object p1, p0, Lcom/estrongs/android/ui/dialog/c0;->f:Lcom/estrongs/android/ui/dialog/d0$c;

    return-void
.end method

.method public a(Z)V
    .locals 0

    .line 1
    iput-boolean p1, p0, Lcom/estrongs/android/ui/dialog/c0;->d:Z

    return-void
.end method

.method public a()Z
    .locals 4

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    invoke-virtual {v0}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    .line 4
    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    .line 5
    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v1

    array-length v1, v1

    const/4 v2, 0x0

    const/16 v3, 0xff

    if-le v1, v3, :cond_0

    .line 6
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->a:Landroid/content/Context;

    const v1, 0x7f1106af

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1, v2}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;Ljava/lang/CharSequence;I)V

    return v2

    .line 7
    :cond_0
    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v1

    const/4 v3, 0x1

    if-ge v1, v3, :cond_1

    .line 8
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->a:Landroid/content/Context;

    const v1, 0x7f1106ae

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1, v2}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;Ljava/lang/CharSequence;I)V

    return v2

    .line 9
    :cond_1
    iget-boolean v1, p0, Lcom/estrongs/android/ui/dialog/c0;->e:Z

    if-eqz v1, :cond_2

    .line 10
    invoke-static {v0}, Lcom/estrongs/fs/util/f;->a(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_2

    .line 11
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->a:Landroid/content/Context;

    const v1, 0x7f1106ad

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1, v2}, Lcom/estrongs/android/ui/view/d;->a(Landroid/content/Context;Ljava/lang/CharSequence;I)V

    return v2

    .line 12
    :cond_2
    iget-object v1, p0, Lcom/estrongs/android/ui/dialog/c0;->f:Lcom/estrongs/android/ui/dialog/d0$c;

    if-eqz v1, :cond_3

    .line 13
    invoke-interface {v1, v0}, Lcom/estrongs/android/ui/dialog/d0$c;->a(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_3

    return v3

    .line 14
    :cond_3
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->b:Landroid/app/Dialog;

    invoke-virtual {v0}, Landroid/app/Dialog;->dismiss()V

    return v3
.end method

.method public b()Landroid/view/View;
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    return-object v0
.end method

.method public c()V
    .locals 4

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->g:Ljava/lang/String;

    if-eqz v0, :cond_1

    .line 2
    iget-object v1, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    invoke-virtual {v1, v0}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->g:Ljava/lang/String;

    const-string v1, "."

    invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lcom/estrongs/android/ui/dialog/c0;->d:Z

    if-eqz v0, :cond_0

    .line 4
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    const/4 v2, 0x0

    iget-object v3, p0, Lcom/estrongs/android/ui/dialog/c0;->g:Ljava/lang/String;

    invoke-virtual {v3, v1}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v2, v1}, Landroid/widget/EditText;->setSelection(II)V

    goto :goto_0

    .line 5
    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/c0;->c:Landroid/widget/EditText;

    invoke-virtual {v0}, Landroid/widget/EditText;->selectAll()V

    :cond_1
    :goto_0
    return-void
.end method
